package com.geek.javase.ch17.videodemo;

import java.net.InetAddress;
import java.net.UnknownHostException;

/*
 *@author wangpeng
 *2025/11/4 11:37
 *@description TODO
 */
public class InetAddressDemo {
    public static void main(String[] args) throws UnknownHostException {
        InetAddress localHost = InetAddress.getLocalHost();
        //System.out.println(localHost);
        //System.out.println(localHost.getHostAddress());
        //System.out.println(localHost.getHostName());

        /*InetAddress address1 = InetAddress.getByName("www.baidu.com");
        System.out.println(address1.getHostName());
        System.out.println(address1.getHostAddress());*/


    }
}
